package cn.iocoder.yudao.module.member.dal.mysql.siteconfiguration;

import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.member.dal.dataobject.siteconfiguration.UserPoolConfigDetailDo;
import cn.iocoder.yudao.module.member.dal.dataobject.siteconfiguration.UserPoolConfigDo;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface UserPoolConfigDetailMapper extends BaseMapperX<UserPoolConfigDetailDo> {
    default void deleteBySiteId(Long id){
        delete(new LambdaQueryWrapper<UserPoolConfigDetailDo>()
                .eq(UserPoolConfigDetailDo::getSiteUserCode, id));
    }

    default List<UserPoolConfigDetailDo> selectListBySiteUserCode(String siteUserCode){
        return selectList(new LambdaQueryWrapper<UserPoolConfigDetailDo>().eq(UserPoolConfigDetailDo::getSiteUserCode, siteUserCode));
    }

    default List<UserPoolConfigDetailDo> selectListALL(){
        return selectList();
    }

    default void deleteBySiteCode(String code){
        delete(new LambdaQueryWrapper<UserPoolConfigDetailDo>()
                .eq(UserPoolConfigDetailDo::getSiteCode, code));
    }


    default void deleteBySiteUserCode(String siteUserCode){
        delete(new LambdaQueryWrapper<UserPoolConfigDetailDo>()
                .eq(UserPoolConfigDetailDo::getSiteUserCode, siteUserCode));
    }
}
